package chapter15;

/**
 * Created by lzy
 * Date: 2018/5/14
 */
public class DynamicProxyMixin {
    public static void main(String[] args) {
        Object mixin = MixinProxy.newInstance(new TwoTuple(new BasicImp(),Basic.class),new TwoTuple(new TimeStampedImp(),TimeStamped.class),new TwoTuple(new SerialNumberedImp(),SerialNumbered.class));
        Basic b = (Basic)mixin;
        TimeStamped t = (TimeStamped)mixin;
        SerialNumbered s =(SerialNumbered)mixin;
        b.set("Hello");
        System.out.println(b.get());
        System.out.println(t.getStamp());
        System.out.println(s.getSerialNumber());
    }
}
